package com.zwh.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 熔断降级端点实现
 * 降级控制器处理熔断请求
 */
@RestController
public class FallbackController {

    @GetMapping("/fallback/order")
    public ResponseEntity<String> orderFallback() {
        return ResponseEntity.status(503)
                .body("订单服务不可用，请稍后重试");
    }

    @GetMapping("/fallback/user")
    public ResponseEntity<String> userFallback() {
        return ResponseEntity.status(503)
                .body("用户服务繁忙，请稍后再试");
    }

}
